1. Field of the Invention
The present invention relates to a numerical control (NC) device for performing machining processes in precision at high speeds by changing in-position values depending on various commands.
2. Description of the Related Art
Numerical control devices can be used for controlling, for example, a machine tool. Such a numerical control device is provided with a numerical control program by which a tool of the machining equipment is guided in regards to a workpiece. Servo motors for moving the tool are connected to servo circuitry for driving respective axes of servo motors. An error register is provided in the circuitry for each axis. The error registers are for storing deviations between commanded movement amounts and actual movement amounts of the tool.
To perform machining operations, the numerical control device retrieves one block of the numerical control program. When the block of program includes a command for moving the tool, such as to position the tool or to cut with the tool, the machining processes, that is, positioning or cutting, are executed by driving the servo motors of the relevant axes according to the command contained in the block of program. To reach a target position, the servo motors are repeatedly rotated in one direction and then the opposite direction, whereby the tool overshoots the target position by less with each switch in rotation direction, to thus move the tool increasingly closer to the target position.
Whether or not the tool has reached the target position commanded by the block of program is determined by whether the deviation in each error register is within a predetermined range. This predetermined range will be referred to as an in-position value hereinafter. When the tool is within the in-position value, the next process in the block is started. This can allow machining a workpiece into a shape commanded by the numerical control program.
When the in-position value is set to a small value, positioning is precise, but a great deal of time is required to maneuver the tool to fall within the in-position value because the servo motors must be switched between positive and negative rotation a great number of times. On the other hand, when the in-position value is set to a large value, only a short time is required to maneuver the tool until it falls within the in-position value. Although the next process can be quickly undertaken, positioning precision is poor. For this reason, in a numerical control device, two types of in-position values are prepared: a large value and a small value. The small in-position value is used when precise positioning is required, and the large in-position value is used when rough positioning can be tolerated.
U.S. Pat. No. 4,949,025 describes determining whether the small or the large in-position value should be adopted based on two consecutive commands. For example, the large value may be employed if two consecutive movement commands are both rapid feed commands or if one is a rapid feed command and the other a cutting command, and the small value may be employed if both are cutting commands. With this technique, total process time can be shortened while precision is maintained.
However, FIGS. 1(A) and 1(B) depict possible problems that can arise with the technique described in U.S. Pat. No. 4,949,025 when the present block is a movement command, for example, a command for positioning the tool in a plane defined by the X and Y axes, and the next block is a non-movement command whose execution time is very short such as a command for turning ON a flow of coolant. As shown in FIG. 1(A), when, based on the combination of a movement command in the present block and the non-movement command in the next block, the in-position value for the present block is set to the large value, flow of coolant is turned ON at time a, before positioning of the tool in the plane of X and Y axes is completed. Flow of coolant is completed at time b, whereupon execution of the next block begins. Because coolant flows for only a short duration of time, the tool has not yet reached the target position in the plane of X and Y axes at time b. When, as depicted in FIG. 1(A), the following block is a movement command for cutting in the direction of the Z axis, cutting starts from an inaccurate position because the tool has not been accurately positioned in the X-Y plane, thus resulting in inferior machining.
Inaccurate cutting caused by the problem depicted in FIG. 1(A) can be overcome by setting the in-position value for the present block to the small value based on the combination of a movement command in the present block and the non-movement command in the next block. However, this creates another problem, as depicted in FIG. 1(B). When, as in this example, the command following the non-movement command is a positioning command for moving in the Z axis direction, positioning in the X-Y plane is continued until time c at which time the tool is precisely positioned over the target position. Such precision is unnecessary for the non-movement command of turning flow of coolant ON. This unnecessary precision increases total machining time t2.